package com.supreme.aspectserver.component;

import com.supreme.common.constant.ConsoleColors;
import org.springframework.beans.factory.BeanNameAware;
import org.springframework.beans.factory.DisposableBean;
import org.springframework.beans.factory.InitializingBean;
import org.springframework.stereotype.Component;

@Component
public class BeanLife implements BeanNameAware, InitializingBean, DisposableBean {

    @Override
    public void setBeanName(String beanName) {
        ConsoleColors.println(ConsoleColors.RED_BOLD_BRIGHT, "setBeanName: " + beanName);
    }

    @Override
    public void destroy() throws Exception {
        ConsoleColors.println(ConsoleColors.RED_BOLD_BRIGHT, "destroy");
    }

    @Override
    public void afterPropertiesSet() throws Exception {
        ConsoleColors.println(ConsoleColors.RED_BOLD_BRIGHT, "afterPropertiesSet");
    }
}
